In the prior art, a controller controls the path of a mechanical arm by following time-dependent commands that instruct the mechanical arm to follow a desired path. Although the commands are applied to the mechanical arm in a closed-loop configuration, the mechanical arm follows the desired path in an open loop manner because there is no direct measurement or feedback of the mechanical arm's deviation from the desired path. If the desired path of the mechanical arm is blocked, the commands may not compensate for the presence of the blockage. Accordingly, the mechanical arm, its propulsion system or a work site may be damaged from the mechanical arm's interaction with the blockage. Thus, a need exists for a controller that controls a mechanical arm to correct the movement of a mechanical arm from an actual path to a desired path.